package com.study.guapo.singleton.hungry;

/**
 * @ClassName: HungrySingleton
 * @Description: 饿汉式单例
 * @author: Adminstrator
 * @Date: 2019-03-10 16:54
 */
public class HungrySingleton {

    //私有的构造函数，保证外类不能实例化本类
    private HungrySingleton(){}
    //自己创建一个类的实例化
    private static final HungrySingleton singleton = new HungrySingleton();
    //创建一个get方法，返回一个实例s
    public static HungrySingleton getInstance(){
        return singleton;
    }
}


